﻿namespace Study.API.ApiResponses
{
    /// <summary>
    /// 响应模型
    /// </summary>
    public class ApiResponse<T>
    {
        /// <summary>
        /// 业务状态码
        /// </summary>
        public int ResultCode { get; set; }
        /// <summary>
        /// 响应消息
        /// </summary>
        public string Msg { get; set; }
        /// <summary>
        /// 响应内容
        /// </summary>
        public T? Data { get; set; }
        /// <summary>
        /// 错误信息
        /// </summary>
        public List<ErrorDetail>? Errors { get; set; }
        /// <summary>
        /// 是否成功
        /// </summary>
        public bool IsSuccess { get; set; } = true;
        /// <summary>
        /// 分页信息
        /// </summary>
        public Pagination? Pagination { get; set; } 
    }
    public class ErrorDetail
    {
        public string Field { get; set; } // 错误字段（如 "Email"）
        public string Message { get; set; } // 错误描述（如 "邮箱格式无效"）
    }
    public class Pagination
    {
        public int TotalCount { get; set; }
        public int PageSize { get; set; }
        public int CurrentPage { get; set; }
    }


}
